<template>
  <d2-container class="page">
    <d2-page-cover>
      <d2-icon-svg class="logo" name="d2-admin" />
      {{info}}
    </d2-page-cover>
  </d2-container>
</template>

<script>
import { mapState, mapActions } from 'vuex'
import D2PageCover from "./components/d2-page-cover";
export default {
   computed: {
    ...mapState('d2admin/user', [
      'info'
    ])
  },
  components: {
    D2PageCover,
  },
  data() {
    return {
      filename: __filename,
    };
  },
  methods: {
    //获取权限列表
    getInfo() {
     this.$axios.get("/common/getUserInfo").then((result) => {
        console.log("用户信息", result);
        
           this.$store.dispatch('d2admin/user/set',{
              name:result.data.username
            },{root:true})
       
      });
    },
  },
   mounted() {
    this.getInfo();
  },
};
</script>

<style lang="scss" scoped>
.page {
  .logo {
    width: 120px;
  }
}
</style>
